/// <reference path="../typings/index.d.ts" />
/// <reference path="../src/attachmentService.ts" />
/// <reference path="../src/tms.ts" />

describe("getAttachmentList",()=>{
    var injector:ng.auto.IInjectorService;
    var service:IAttachmentService;

    beforeEach(()=>{
        injector=angular.injector(['ng','tms']);
        service=injector.get<IAttachmentService>('attachmentService');
    });

    //下载文件
    it('download attachment',(done)=>{
        service.getAttachment('1').then((res)=>{
            expect(res.data.extData).toBe("1");
            done();
        },(err)=>{
            done.fail(err);
        });
    });

    //上传文件
    it('post attachment',(done)=>{
        service.postAttachment().then((res)=>{
            expect(res.data.filePath).toBe("C:\Users")
            expect(res.data.extData).toBe("1");
            done();
        },(err)=>{
            done.fail(err);
        });
    });

});